package com.jumi.microservice.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jumi.microservice.entity.AfterSealOrder;
import com.jumi.microservice.entity.AfterSealOrderGoods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author new
 * @date 2020/9/24
 */
@Mapper
public interface AfterSealOrderGoodsMapper extends BaseMapper<AfterSealOrderGoods> {

    /**
     * "
     * @param afterSealOrders
     */
    @Update("<script><foreach collection='list' item='l' index='index' separator=';'>" +
            " UPDATE after_seal_order_goods SET " +
            " goods_status = 2,remark = if(remark!='',CONCAT(remark,'，',#{l.remark}),#{l.remark}) " +
            " WHERE order_id = #{l.id} " +
            "</foreach></script>")
    void updateGoodsStatus(List<AfterSealOrder> afterSealOrders);
}
